home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / amiga.programming / comp.sys.amiga.programmer_5651_000027.msg < prev    next >
Encoding:
Internet Message Format  |  1994-11-27  |  2.0 KB

  1. Path: dd.chalmers.se!news.chalmers.se!sunic!pipex!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!scsing.switch.ch!news.dfn.de!rrz.uni-koeln.de!teralon!dino.dinoco.de!yaps.dinoco.de!arno
  2. From: arno@yaps.dinoco.de (Arno Eigenwillig)
  3. Message-ID: <710.ANN@yaps.dinoco.de>
  4. Date: Tue, 08 Feb 1994 15:44:25 +0100
  5. Organization: Yet Another Private Site in Meckenheim, Germany
  6. Newsgroups: comp.sys.amiga.programmer
  7. Reply-To: arno@yaps.dinoco.de (Arno Eigenwillig)
  8. Subject: Re: How to detatch from cli.
  9. References: <2ivot9$o3d@harbinger.cc.monash.edu.au>
  10. X-Newsreader: Ann 0.10
  11. Lines: 33
  12.  
  13. Hi!
  14.  
  15. In article <2ivot9$o3d@harbinger.cc.monash.edu.au>,
  16.     ins557g@aurora.cc.monash.edu.au (Mark Brophy) writes:
  17.  
  18. >     can someone enlighten me on how to detatch from the cli
  19. >     in a C program. At the moment I'm forkl() ing which
  20. >     seems a little like overkill???
  21.  
  22. 1. The first code hunk of your program should be a little assembler
  23. routine which backups the pointer to the next segment, zeroes the
  24. original pointer, creates a new process with the backuped pointer, and
  25. terminates.
  26.  
  27. 2. Alternatively, it is said that zeroing the cli_Module field in the
  28. CommandLineInterface structure BCPL-pointed to by a CLI process' pr_CLI
  29. will prevent the DOS from unloading any of your code so that you may use
  30. a technique like described above to keep your whole program in memory,
  31. malking a HLL implementation of auto detaching easier.
  32.  
  33. 3. Although Ralph Babel's excellent Amiga Guru Book documents both
  34. methods above, he suggests RUNning the program as the most compatible
  35. way, although having a program RUN itself implies just the overhead you
  36. wanted to avoid in the first place.
  37.  
  38. Any comments welcome.
  39.  
  40. --                  __                            __
  41. Arno Eigenwillig __/// arno@yaps.dinoco.de     __/// FIDO-Net (untested)
  42. ++49-2225-5870   \XX/  ARNO@FUTURE.ZER.sub.org \XX/ 2:2402/330.99  2:2440/99
  43.  
  44. Objects may be divided up in three categories: malfunctioning objects,
  45. objects getting broken and objects getting lost. [Russel Baker]
  46.